home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / win_u_z / vlistsam.zip / DLLSTUFF.C < prev    next >
C/C++ Source or Header  |  1992-06-09  |  3KB  |  93 lines

  1. //---------------------------------------------------------------------------
  2. //  DLLSTUFF - Windows DLL support functions
  3. //
  4. //  This File contains the source code for the standard DLL functions
  5. //
  6. //  Author:     Kyle Marsh
  7. //              Windows Developer Technology Group
  8. //              Microsoft Corp.
  9. //
  10. //---------------------------------------------------------------------------
  11.  
  12. #include "vlistint.h"
  13.  
  14. //---------------------------------------------------------------------------
  15. // Function declarations
  16. //---------------------------------------------------------------------------
  17.  
  18. int   FAR PASCAL LibMain(HANDLE hModule, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine);
  19. int   FAR PASCAL WEP (int bSystemExit);
  20.  
  21. //---------------------------------------------------------------------------
  22. // Global Variables...
  23. //---------------------------------------------------------------------------
  24.  
  25. HANDLE  hInstance;              // Global instance handle for  DLL
  26.  
  27. //---------------------------------------------------------------------------
  28. // LibMain
  29. //---------------------------------------------------------------------------
  30. int FAR PASCAL LibMain(HANDLE hModule, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine)
  31. {
  32.     hInstance = hModule;
  33.  
  34.     RegisterVListBox(hInstance);
  35.  
  36.     return 1;
  37. }
  38.  
  39.  
  40.  
  41. // RegisterVListBox
  42. //
  43. // Purpose:
  44. //  Registers the Virtual List Box control class
  45. //
  46. // Parameters:
  47. //  hInstance     HANDLE Instance of the application or DLL that will
  48. //                own this class.
  49. //
  50. // Return Value:
  51. //  BOOL                  TRUE if the class is registered, FALSE otherwise.
  52. //                TRUE is also returned if the class was already
  53. //                registered.
  54.  
  55. BOOL RegisterVListBox(HANDLE hInstance)
  56. {
  57. static BOOL     bRegistered=FALSE;
  58. WNDCLASS        wndcls;
  59. char            szVListBox[10];
  60.  
  61.    if (!bRegistered) {
  62.  
  63.        LoadString(hInstance, IDS_VLBOXNAME, szVListBox, 10);
  64.  
  65.        wndcls.style         = CS_DBLCLKS| CS_GLOBALCLASS|CS_PARENTDC;
  66.        wndcls.lpfnWndProc   = VListBoxWndProc;
  67.        wndcls.cbClsExtra    = 0;
  68.        wndcls.cbWndExtra    = sizeof(HANDLE);
  69.        wndcls.hInstance     = hInstance;
  70.        wndcls.hIcon         = NULL;
  71.        wndcls.hCursor       = LoadCursor(NULL, IDC_ARROW);
  72.        wndcls.hbrBackground =  (HBRUSH)(COLOR_WINDOW+1);
  73.        wndcls.lpszMenuName  = NULL;
  74.        wndcls.lpszClassName = (LPSTR)szVListBox;
  75.  
  76.        bRegistered=RegisterClass(&wndcls);
  77.  
  78.    }
  79.  
  80.    return bRegistered;
  81. }
  82.  
  83.  
  84. #pragma alloc_text(FIXEDSEG, WEP)
  85.  
  86. //---------------------------------------------------------------------------
  87. // WEP
  88. //---------------------------------------------------------------------------
  89. int FAR PASCAL WEP (int bSystemExit)
  90. {
  91.     return(1);
  92. }
  93.